﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Menafrinet.View.Controls
{
    /// <summary>
    /// Interaction logic for HomePanel.xaml
    /// </summary>
    public partial class HomePanel : UserControl
    {
        public HomePanel()
        {
            InitializeComponent();

            //string appDir = Environment.CurrentDirectory; Uri pageUri = new Uri(appDir + "/Projects/Menafrinet/Html/Home.html");
            //browser.Source = pageUri; 
        }

        private void btnJobAid1_Click(object sender, RoutedEventArgs e)
        {
            string filePath = Properties.Settings.Default.JobAid1URL;

            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.StartInfo.FileName = filePath;
            //proc.StartInfo.Arguments = string.Format("\"{0}\"", "Projects\\ProjectFolderName\\File.extension");
            proc.StartInfo.UseShellExecute = true;
            try
            {
                proc.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show("An error occurred: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }

        private void btnJobAid2_Click(object sender, RoutedEventArgs e)
        {
            string filePath = Properties.Settings.Default.JobAid2URL;

            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.StartInfo.FileName = filePath;
            //proc.StartInfo.Arguments = string.Format("\"{0}\"", "Projects\\ProjectFolderName\\File.extension");
            proc.StartInfo.UseShellExecute = true;
            try
            {
                proc.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show("An error occurred: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
    }
}
